package com.ssh.controller.index;

import com.ssh.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * 文 件 名 称：IndexController.
 * 文 件 说 明：
 * 创   建   人：zpen.
 * 创 建 时 间：2018/2/28 16:45.
 */
@Controller
@RequestMapping(value = "index.action")
public class IndexController {

    @RequestMapping
    public String goIndex(HttpSession session, HttpServletRequest request, Model model){
        User user = (User) session.getAttribute("user");
        model.addAttribute("user",user);
        model.addAttribute("ctx",request.getContextPath());
        return "index/index";
    }
}
